import 'package:face_cal/l10n/messages_all.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';

class S {
  S(this.localeName);

  static Future<S> load(Locale locale) {
    final String name = locale.countryCode?.isEmpty ?? false
        ? locale.languageCode
        : locale.toString();
    final String localeName = Intl.canonicalizedLocale(name);
    return initializeMessages(localeName).then((_) {
      return S(localeName);
    });
  }

  static S of(BuildContext context) {
    return Localizations.of<S>(context, S)!;
  }

  final String localeName;

  String get calculator {
    return Intl.message(
      'Calculator',
      name: 'calculator',
      desc: 'Title for the calculator app',
      locale: localeName,
    );
  }

  String get settings {
    return Intl.message(
      'Settings',
      name: 'settings',
      desc: 'Title for the settings page',
      locale: localeName,
    );
  }

  String get instructions {
    return Intl.message(
      'Instructions',
      name: 'instructions',
      desc: 'Title for the instructions option',
      locale: localeName,
    );
  }

  String get feedback {
    return Intl.message(
      'Feedback',
      name: 'feedback',
      desc: 'Title for the feedback option',
      locale: localeName,
    );
  }

  String get privacyPolicy {
    return Intl.message(
      'Privacy Policy',
      name: 'privacyPolicy',
      desc: 'Title for the privacy policy option',
      locale: localeName,
    );
  }

  String get userAgreement {
    return Intl.message(
      'User Agreement',
      name: 'userAgreement',
      desc: 'Title for the user agreement option',
      locale: localeName,
    );
  }

  String get checkForUpdates {
    return Intl.message(
      'Check for Updates',
      name: 'checkForUpdates',
      desc: 'Title for the check for updates option',
      locale: localeName,
    );
  }
}
